home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / misc / vhlogger_v2.lzh / usnet.vh < prev    next >
Text File  |  1992-08-30  |  2KB  |  92 lines

  1.  
  2. /* usnet.vh Copyright (c) 1992 Vincent J. Herried
  3.                  1688 Staffordshire RD.
  4.                  Columbus, OH 43229
  5.                  KA8CTE           */
  6.  
  7. /*
  8. Function:   Read in a sequential ascii text file,
  9.         parse it, get the call signs out,
  10.         search the vhlogger data base for the call sign,
  11.         If it does not exist in my vhlogger data base then
  12.         add it.
  13.  
  14. Arguments:  None
  15.  
  16. History:
  17.         Version 2 08/30/92    add correct test for EOF
  18.         Version 1 02/04/92    initial version.
  19.  
  20.  
  21.  
  22. */
  23.  
  24. options results
  25. address "vhlogger"
  26.  
  27. /* Open the ascii input file that we are going to parse for call signs */
  28.  
  29. say   "Enter a ascii input file name or 'end'?"
  30. parse pull file
  31. if file = "END" then exit(0)
  32. if (open("input",file,"Read") = 0) then do
  33.    say "Open failed for file" file
  34.    exit(0)
  35. end
  36.  
  37. dateval="920702"   /* date of this ascii file was built */
  38.  
  39. startt=time()
  40. count=0
  41. do while(get())
  42.    parse var in address '(' name ')' callsign junk
  43.    if substr(address,1) = '#' then iterate
  44.    if callsign = "" then iterate
  45.    if name = "" then iterate
  46.    count = count +1
  47.    callsign = strip(callsign)
  48.    len=length(callsign)
  49.    if (len > 10 | len < 3 )then iterate
  50.    address = strip(address)
  51.    if index(address,"GEnie") ~= 0 then do
  52.       say "skiping genie address"
  53.       iterate
  54.    end
  55.    name = strip(name)
  56.  
  57.    say "Call="callsign "Name="name "Address="address
  58.  
  59.    update=callsign';'name';'dateval';;;;;;;;;'address';'
  60.  
  61.    'find' callsign
  62.    if rc = 0 then iterate     /* already in data base, skip it */
  63.  
  64.    ans='A'
  65.    do while(ans ~= 'A' & ans ~= 'S' & ans ~= 'E')
  66.       say "reply Add, Skip, or End"
  67.       pull ans
  68.    end
  69.    if ans = 'E' then exit(0)
  70.    if ans = 'S' then iterate
  71.    'update' update
  72. end
  73.  
  74. close('input')
  75. say "count"count "start time" startt "end time" time()
  76. say "all done, bye"
  77. exit(0)
  78.  
  79. get:
  80. in=''
  81. b_count = 0
  82. do while(in='')
  83.   in=readln("input")
  84.   b_count = b_count +1
  85.   if b_count > 20 then return(0) /* more than 20 blank lines = eof? */
  86.   if eof("input") = 1 then return(0)  /* really End Of File */
  87. end
  88. in=translate(in,' ','09'x,)
  89. return(1)
  90.  
  91.  
  92.